﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Warehouse.Core;
using FluentNHibernate.Mapping;

namespace Tanmia.Warehouse.NHibernateRepository.Mapping
{
    public class ItemUnitMap : ClassMap<ItemUnit>
    {
        public ItemUnitMap()
        {
            Table("ItemUnit");

            Id(x => x.ItemUnitID).Not.Nullable().Unique();
            Map(x => x.Scale).Not.Nullable();
            References(x => x.Unit, "UnitID").Not.Nullable();
            HasMany<ItemUnitPrice>(x => x.ItemUnitPrices).KeyColumn("ItemUnitID").Inverse();
        }
    }
}
